package com.hill;

import com.sun.org.apache.xpath.internal.SourceTree;

import java.util.Scanner;

public class ScannerTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("使用next方式接收");
        if (scanner.hasNext()){
            String str = scanner.next();
            System.out.println("输出内容为：" + str);
        }
        //凡是IO资源用完要关闭。
        scanner.close();

    }
}
